package com.aiwei.tdjk.dto.response;

import lombok.Data;

import java.util.HashMap;

/**
 * Created by yanfeng on 2018/1/18.
 */
@Data
public class MatchHandBookResponse implements Comparable<MatchHandBookResponse>{

    //手册id
    private Long customerHandBookId;

    private Long customsHandbookProductdetailId;  //作废不用的字段

    private Boolean fit = true;

    //规格  对应的=》(未冻结的)数量
    private HashMap<String,Integer> map;

    //(未冻结的)规格的总量
    private int totalFitCount;


    @Override
    public int compareTo(MatchHandBookResponse o) {
        // 先按age排序
//        if (this.fit.compareTo(o.getFit())>0) {
//            return 1;
//        }
//
//        if (this.totalFitCount > o.getTotalFitCount()) {
////            return (this.totalFitCount - o.getTotalFitCount());
//            return (o.getTotalFitCount()-this.totalFitCount);
//        }
//        return 0;

        return o.getTotalFitCount()-this.getTotalFitCount();
    }

    public MatchHandBookResponse(){
    }

    public MatchHandBookResponse(Boolean fit,int totalFitCount){
        this.fit = fit;
        this.totalFitCount=totalFitCount;
    }


}
